package packge.obj;

class ObTest3 {
	public static void main(String str[]) {
		Student2 st1 = new Student2(12);
		Student2 st2 = new Student2(99);
		Student2 st3 = st1;
		System.out.println(st1.hashCode());
		System.out.println(st2.hashCode());
		System.out.println(st3.hashCode());
		Employee emp1 = new Employee(99);
		Employee emp2 = new Employee(989);
		Employee emp3 = new Employee(23);
		System.out.println(emp1.hashCode());
		System.out.println(emp2.hashCode());
		System.out.println(emp3.hashCode());
		System.out.println("--------------------------------------------------------");
		String mn = "JLC-";
		mn = mn + st1;
		System.out.println(mn);
		System.out.println(st1);
		System.out.println(st1.toString());
		String cName = st1.getClass().getName();
		int ab = st1.hashCode();
		String hx = Integer.toHexString(ab);
		String value = cName + "@" + hx;
		System.out.println(value);
		System.out.println(emp1);
		System.out.println(emp3);
		String bn = "JLC-";
		Student st11 = null;
		bn = bn + st11;
		System.out.println(bn);
		System.out.println(st11);
		System.out.println(st11.toString()); // NULL P.E.
	}
}

class Student2 {
	int sid;

	Student2(int sid) {
		this.sid = sid;
	}
}

class Employee {
	int eid;

	Employee(int eid) {
		this.eid = eid;
	}

	public int hashCode() {
		return eid << 2;
	}

	public String toString() {
		return "Eid:" + eid;
	}
}